import java.util.*;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 09 - 18
 * Time: 18:17
 */
//牛客 组队竞赛
public class Solution1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int[] arr = new int[3 * n];
            for(int i = 0; i < arr.length; i++) {
                arr[i] = in.nextInt();
            }
            Arrays.sort(arr);
            long sum = 0;
            for(int i = 0; i < n; i++) {
                sum += arr[arr.length - 2 * (i + 1)];
            }
            System.out.print(sum);
        }
    }
}
